<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
	
	//保存提示三秒自动消失
	function showSuccess() {
		$("#base_info_tip_success").show();
		setTimeout("$('#base_info_tip_success').hide()",3000);
	}

	//加载家的资料的页面
	function familyTab(type) {
		$("#newNews1").attr("class", "h_newNewsHover");
		jiaZiLiao();
		switch (type) {
			case '1': {
				$("#member_info_detail").load("familyInfo.htm");
				$("#jiaZiLiao1").attr("class", "current");
				break;
			}
			case '2': {
				$("#member_info_detail").load("familyAvatar.htm");
				$("#jiaZiLiao2").attr("class", "current");
				break;
			}
			case '3': {
				$("#member_info_detail").load("babyInfo.htm");
				$("#jiaZiLiao3").attr("class", "current");
				break;
			}
			case '4': {
				$("#member_info_detail").load("familyTag.htm");
				$("#jiaZiLiao4").attr("class", "current");
				break;
			}
			case '5': {
				$("#member_info_detail").load("toAddFamilyMember.htm");
				break;
			}
		}
	}
	
	//加载个人资料的页面
	function memberTab(type) {
		if($("#memberId").html()!=""){
			$("#detail_all_tab").find("li").each(function(){
				if($(this).attr("value")==$("#memberId").html()){
					$(self).attr("class", "h_newNewsHover");
				}
			});
		}else{
			$("#newNews2").attr("class", "h_newNewsHover");
		}
		gxzl();
		switch (type) {
		case '1': {
			$("#member_info_detail").load("baseInfo.htm?memberId="+$("#memberId").html());
			$("#gxzl1").attr("class", "current");
			break;
		}
		case '2': {
			$("#member_info_detail").load("avatar.htm?memberId="+$("#memberId").html());
			$("#gxzl2").attr("class", "current");
			break;
		}
		case '3': {
			//个人资料管理
			$("#member_info_detail").load("memberSpecial.htm?memberId="+$("#memberId").html());
			$("#gxzl3").attr("class", "current");
			break;
		}
		case '4': {
			//个人经历
			$("#member_info_detail").load("memberExper.htm?memberId="+$("#memberId").html());
			$("#gxzl4").attr("class", "current");
			break;
		}
		case '5': {
			//联系方式
			$("#member_info_detail").load("enterContact.htm?memberId="+$("#memberId").html());
			$("#gxzl5").attr("class", "current");
			break;
		}
		case '6': {
			//修改密码
			$("#member_info_detail").load("entrySetAccount.htm?memberId="+$("#memberId").html());
			$("#gxzl6").attr("class", "current");
			break;
		}
		case '7': {
			break;
		}
		}

	}

	//清除个人资料的样式
	function gxzl() {
		$("#gxzl1").attr("class", "");
		$("#gxzl2").attr("class", "");
		$("#gxzl3").attr("class", "");
		$("#gxzl4").attr("class", "");
		$("#gxzl5").attr("class", "");
		$("#gxzl6").attr("class", "");
	}
	
	//清除家的资料的样式
	function jiaZiLiao() {
		$("#jiaZiLiao1").attr("class", "");
		$("#jiaZiLiao2").attr("class", "");
		$("#jiaZiLiao3").attr("class", "");
		$("#jiaZiLiao4").attr("class", "");
	}
	
	//清除tab的样式
	function clearTab(){
		$("#newNews1").attr("class", "");
		$("#newNews2").attr("class", "");
		$("#newNews3").attr("class", "");
		$("#newNews4").attr("class", "");
		$("#newNews5").attr("class", "");
		$("#newNews6").attr("class", "");
	}

	//控制tab的页面切换，以及初始化
	function showTab(id) {
		clearTab();	//清除样式
		hideTab();	//隐藏
		$("#jiaGuanLi" + id).show();
		switch (id) {
			case '1': {
				jiaZiLiao();
				$("#member_info_detail").load("familyInfo.htm");
				$("#jiaZiLiao1").attr("class", "current");
				$("#newNews1").attr("class", "h_newNewsHover");
				break;
			}
			case '2': {
				gxzl();
				$("#memberId").html("");
				$("#member_info_detail").load("baseInfo.htm");
				$("#gxzl1").attr("class", "current");
				$("#newNews2").attr("class", "h_newNewsHover");
				break;
			}
		}
	}
	
	//控制登录着以后的tab的页面切换，以及初始化
	function showOtherTab(id) {
		clearTab();	//清除样式
		hideTab();	//隐藏
		var memberId = $("#"+id).attr("value");
		$("#memberId").html(memberId);
		$("#member_info_detail").load("baseInfo.htm?memberId="+memberId);
		$("#jiaGuanLi2").show();
		gxzl();
		$("#gxzl1").attr("class", "current");
		$("#"+id).attr("class", "h_newNewsHover");
	}

	function hideTab() {
		$("#jiaGuanLi1").hide();
		$("#jiaGuanLi2").hide();
		$("#jiaGuanLi3").hide();
		$("#jiaGuanLi4").hide();
	}
	
</script>
 
	<div class="h_main2">
		<div class="h_data">
			<h2>家管理</h2>
			<div class="h_newNews">
				<ul id="detail_all_tab">
					<li id="newNews1" onclick="showTab('1')"
						class="h_newNewsHover"><a>家管理</a>
					</li>
					<li id="newNews2" onclick="showTab('2')"><a>${sessionScope.member.username }的账户</a></li>
					<c:set value="2" var="tabIndex" scope="page" />
					<c:forEach items="${memberList }" var="m">
						<c:if test="${m.identifier!=sessionScope.member.identifier }">
							<li id="newNews${tabIndex+1 }" value="${m.identifier }" onclick="showOtherTab('newNews${tabIndex+1 }')"><a>${m.username }的账户</a></li>
							<c:set value="${tabIndex+1 }" var="tabIndex" scope="page" />
						</c:if>
					</c:forEach>
					<%--
					<li id="newNews3" onclick=""><a>组件设置</a>
					</li>
					<li id="newNews4" onclick=""><a>邮件提示</a>
					</li>
					<li id="newNews5" onclick=""><a>手机绑定</a>
					</li>
					<li id="newNews6" onclick=""><a>支付中心</a>
					</li>
					 --%>
				</ul>
				<div class="clear"></div>
			</div>

			<div class="h_newNews_box" id="jiaGuanLi1" style="display: block;">
					<div class="data_h_newNews_nav">
						<a href="javascript:void(0);" id="jiaZiLiao1" onclick="familyTab('1')">家基本资料</a>| 
						<a href="javascript:void(0);" id="jiaZiLiao2" onclick="familyTab('2')">全家福</a> | 
						<a href="javascript:void(0);" id="jiaZiLiao4" onclick="familyTab('4')">标签</a> | 
						<a href="javascript:void(0);" id="jiaZiLiao3" onclick="familyTab('3')">宝宝信息</a>
						<c:if test="${fn:length(memberList)<2 }">
							|<a href="javascript:void(0);" id="jiaZiLiao5" style="color: red; font-weight: bold;" onclick="familyTab('5')">添加成员</a>
						</c:if>
					</div>
					<div class="clear"></div>
			</div>

			<div class="h_newNews_box" id="jiaGuanLi2" style="display: none;">
					<div class="data_h_newNews_nav">
						<a href="javascript:void(0);" id="gxzl1" onclick="memberTab('1')">基本资料</a>
						<a href="javascript:void(0);" id="gxzl2" onclick="memberTab('2')">头像修改</a> | 
						<a href="javascript:void(0);" id="gxzl3" onclick="memberTab('3')">个性资料管理</a> |
						<a href="javascript:void(0);" id="gxzl4" onclick="memberTab('4')">个人经历</a>|
						<a href="javascript:void(0);" id="gxzl5" onclick="memberTab('5')">联系方式</a>|
						<a href="javascript:void(0);" id="gxzl6" onclick="memberTab('6')">账户设置</a>
						<%--|
						<a href="javascript:void(0);">账号安全</a>| 
						<a href="javascript:void(0);">隐私管理</a>
						--%>
					</div>
					<div class="clear"></div>
			</div>
			<div id="member_info_detail"></div>
		</div>
		<div class="clear"></div>
	</div>
<%-- 记录选项卡的会员ID --%>
 <div id="memberId"></div>
